package com.bdqn.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bdqn.pojo.User;
import org.apache.ibatis.annotations.Param;

/**
 * 用户Mapper接口，继承MyBaits-Plus的BaseMapper就拥有了强大增删改查等能力
 *
 * @author LILIBO
 * @since 2024/9/5
 */
public interface UserMapper extends BaseMapper<User> {

    /**
     * 根据用户名和密码查询用户
     */
    User getByUsrName(String usrName);

    /**
     * 根据用户名和角色ID分页查询用户及角色数据
     *
     * @param usrName
     * @param roleId
     * @param page
     * @return
     */
    Page<User> findPage(@Param("usrName") String usrName, @Param("roleId") Long roleId, Page page);

    User findUserByUsrName(String usrName);
}
